<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/include.inc.jsp" %>
<!DOCTYPE html>

<html>
<head>
    <%@include file="/WEB-INF/views/layout/base.ref.jsp" %>
    <%@include file="/WEB-INF/views/layout/valid.ref.jsp" %>
</head>
<body>
<style type="text/css">
    body {
        overflow-x: hidden;
    }
</style>
<form method="post" id="sysWebMenuForm" action="${ctx}/sysWebMenu/save">
    <input type="hidden" name="id" value="${sysWebMenu.id}"/> <input type="hidden" name="parentId"
                                                                     value="${sysWebMenu.parentId}"/>
    <div class="mtcontent">
        <div class="mtheader">
            <shiro:hasPermission name="sysWebMenu:edit">
                <a class="mtbtn one" href="${ctx}/sysWebMenu/edit?parentId=${sysWebMenu.id}"><i class="mtfa mt-add"></i><span>添加</span></a>
            </shiro:hasPermission>
            <shiro:hasPermission name="sysWebMenu:edit">
                <a class="mtbtn one" href="#" onclick="hrefSave_OnClick('sysWebMenuForm')"><i
                        class="mtfa mt-dui"></i><span>保存</span></a>
            </shiro:hasPermission>
            <shiro:hasPermission name="sysWebMenu:edit">
                <a class="mtbtn two" href="#" onclick="hrefOneDel_OnClick('${ctx}/sysWebMenu/del','${sysWebMenu.id}')"
                   title="确定要删除吗?"><i class="mtfa mt-refresh"></i><span>删除</span></a>
            </shiro:hasPermission>
        </div>
        <div class="mtbody">
            <div class="mtrow">
                <div class="mtcol2">
                    <label class="mtlabel" for="name">菜单名称 </label> <span
                        class="block mtinput mticon-input mticon-input-right">
							<input type="text" id="name" name="name" class="required" value="${sysWebMenu.name}"/><i
                        class="mtfa mt-star mtred"></i>
						</span>
                </div>
            </div>
            <div class="mtrow">
                <div class="mtcol2">
                    <label class="mtlabel">菜单图片 </label> <input type="text" class="mtinput" name="menuIcon"
                                                                value="${sysWebMenu.menuIcon}"/>
                </div>
            </div>
            <div class="mtrow">
                <div class="mtcol2">
                    <label class="mtlabel">磁贴大小 </label> <select class="mtinput" name="metroSize">
                    <option value="Small" ${sysWebMenu.metroSize eq 'Small' ? 'selected' : ''}>小</option>
                    <option value="Big" ${sysWebMenu.metroSize eq 'Big' ? 'selected' : ''}>大</option>
                </select>
                </div>
            </div>
            <div class="mtrow">
                <div class="mtcol2">
                    <label class="mtlabel">磁贴颜色 </label> <input type="text" class="mtinput" name="metroColor"
                                                                value="${sysWebMenu.metroColor}"/>
                </div>
            </div>
            <%--             <div class="mtrow">
                            <div class="mtcol2">
                                    <label class="mtlabel">磁贴图片 </label> <input type="text" class="mtinput" name="icon"
                                        value="${sysWebMenu.icon}" />
                                </div>
                            </div> --%>
            <div class="mtrow">
                <div class="mtcol2">
                    <label class="mtlabel">桌面图片 </label> <input type="text" class="mtinput" name="deskIcon"
                                                                value="${sysWebMenu.deskIcon}"/>
                </div>
            </div>
            <div class="mtrow">
                <div class="mtcol2">
                    <label class="mtlabel">链接地址 </label> <input type="text" class="mtinput" name="linkUrl"
                                                                value="${sysWebMenu.linkUrl}"/>
                </div>
            </div>
            <div class="mtrow">
                <div class="mtcol2">
                    <label class="mtlabel">是否快捷菜单 </label> <select class="mtinput" name="isQuick">
                    <option value="0" ${sysWebMenu.isQuick eq '0' ? 'selected' : ''}>否</option>
                    <option value="1" ${sysWebMenu.isQuick eq '1' ? 'selected' : ''}>是</option>
                </select>
                </div>
            </div>
            <div class="mtrow">
                <div class="mtcol2">
                    <label class="mtlabel">是否有效 </label>
                    <div class="mtinput">
                        <input type="radio" name="flagValid" value="0"
                               <c:if test="${sysWebMenu.flagValid ==0}">checked </c:if> />有效 <input
                            type="radio" name="flagValid" value="1"
                            <c:if test="${sysWebMenu.flagValid ==1}">checked </c:if> />无效
                    </div>
                </div>
            </div>
            <div class="mtrow">
                <div class="mtcol2">
                    <label class="mtlabel">顺序 </label> <input type="text" class="mtinput" name="showOrder"
                                                              value="${sysWebMenu.showOrder}"/>
                </div>
            </div>
            <div class="mtrow">
                <div class="mtcol2">
                    <label class="mtlabel">菜单权限 </label> <input type="text" class="mtinput" name="rel"
                                                                value="${sysWebMenu.rel}"/>
                </div>
            </div>
            <div class="mtrow">
                <div class="mtcol2">
                    <label class="mtlabel">终端 </label>
                    <input type="checkbox" name="isWeb" ${sysWebMenu.isWeb == 1 ? "checked='checked'":""} value="1">Web
                    <input type="checkbox" name="isApp" ${sysWebMenu.isApp == 1 ? "checked='checked'":""} value="1">App
                </div>
            </div>
            <div class="mtrow">
                <div class="mtcol2">
                    <label class="mtlabel">操作 </label>
                    <div class="mtinput">
                        <c:forEach items="${listOperator}" var="pubTable">
                            <input type="checkbox" name="operator" value="${pubTable.id}"
                                   <c:if test="${pubTable.ylzd1 ==1}">checked</c:if> />${pubTable.name}
                        </c:forEach>
                    </div>
                </div>
            </div>
        </div>
    </div>
</form>
</body>
</html>

<script type="text/javascript">

    $(function () {
        $("#sysWebMenuForm").validate({
            submitHandler: function (form) {
                hrefSave_OnClick("sysWebMenuForm");
            },
            onfocusout: function (element) {
                $(element).valid();
            }
        });
    });

    function btnAjaxCallback(result) {
        if (result != null) {
            layer.close(toolbarIndex);
            if (result.statusCode == 'success') {
                layer.msg(result.message, {icon: 1}, function () {
                    window.parent.location.href = result.forwardUrl;
                });

            } else if (result.statusCode == 'error') {
                layer.msg(result.message, {icon: 2}, function () {
                });
            } else if (result.statusCode == 'noAlert') {

            } else {
                layer.msg('连接错误', {icon: 2});
            }
        }
    }

</script>
